<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>06_DOM操作</title>
</head>
<body>
    <button onclick="addMoney()">点我变有钱</button>
    <hr>
<script>
    function addMoney(){
        //创建空的图片标签
        var imgE = document.createElement('img');
        //设置 src属性值
        imgE.src='img/money.jpg';
        //设置 width的值
        imgE.width=200;
        //找到body
        let bodyE = document.querySelector('body');
        //追加标签到body里
        bodyE.append(imgE)
    }
</script>
</body>
</html>